<%layout("/eova/layout/default.html",{'title' : object.name + '列表'}){%>
<body class="easyui-layout">
<%if(isTrue(isQuery!)){%>
<div id="layoutNorth" region="north" title="快速查询" split="true">
    <#query id="queryForm" items="${fields}" />
</div>
<%}%>
<div data-options="region:'center',fit:false,border:false,split:false">
    <div id="contentLayout" class="easyui-layout" data-options="fit:true">
    	<div data-options="region:'west',split:true" style="width:200px">
            <#tree id="master_tree" />
        </div>
        <div data-options="region:'center'">
            <div id="gridToolbar" style="display: none;">
				<table>
					<tr>
						<td>
							<table>
								<tr>
									<%if(isQuery){%>
									<td><%include("/eova/template/treetogrid/btn/query.html",{'formId':'queryForm', 'gridId':'grid'}){}%></td>
									<%}%>
									<%// 自定义功能按钮%>
									<%for(btn in btnList){%>
									<td><%include(btn.ui,{'object':object, 'gridId':'grid', 'formId':'queryForm', 'button':btn }){}%></td>
									<%}%>
									
									<%// 仅超级管理员可见%>
	        						<%if(session.user.rid == 1){%>
	        						<td><%include("/eova/button/btn/quick.html",{'object':object, 'gridId':'grid', 'formId':'queryForm', 'menuCode': menu.code }){}%></td>
									<%}%>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>
			<#grid id="grid" objectCode="${object.code}" toolbar="gridToolbar" menuCode="${menu.code}" isFirstLoad="false"/>
        </div>
    </div>
</div>
<script>
//Tree Node OnClick
var eova_tree_node_value = '';
var nodeClick = function(node) {
	if (node.attributes.url) {
		var code = node.code;
		// 默认自动选中第一个Tab
        $('#grid').datagrid('load',{
            'query_menu_code': code
        });
        eova_tree_node_value = code;
	}
};
</script>
<script type="text/javascript" src="${STATIC!}/ui/js/template.js"></script>
<%if(!isEmpty(menu.diy_js!)){%>
<script type="text/javascript" src="${menu.diy_js}"></script>
<%}%>
<%if(!isEmpty(object.diy_js!)){%>
<script type="text/javascript" src="${object.diy_js}"></script>
<%}%>
</body>
<%}%>